{% extends "querybuilder/base.html" %}

{% block content %}
    {{ block.super }}
    <form id="qbuilder_form" onSubmit='test_query(); return false;'>
        <table>
            <tr>
                <td colspan="2">
                    Je veux
                    <select id="whattodo" name="whattodo" onChange="select_whattodo(this);">
                        <option value="0"></option>
                        <option value="count">compter</option>
                        <option value="evolution">voir l'évolution dans le temps</option>
                        <option value="event_delta">mesurer l'écart entre des évènements</option>
                        <option value="event_delta_evolution">voir l'évolution dans le temps de l'écart entre des évènements</option>
                        <option value="recover_existing">reprendre une requête mémorisée</option>
                    </select>
                    <div id="model_choose_div" style="display: inline;"></div>
                    <div id="display_type" style="display: none;">
                        Type d'affichage : <div id="display_type_action" style="display: inline;"></div>
                        <div id="active_display_type" style="display: inline;"></div>
                    </div>
                    <button dojoType="dijit.form.Button" onclick="test_query();" style="display: inline;" id='test_query_btn'>
                        <img src="/qbuilder/media/ok.png" height="18px;"/><span>Test</span>
                    </button>
                    <button dojoType="dijit.form.Button" onclick="save_query();" style="display: inline;" id='save_query_btn'>
                        <img src="/qbuilder/media/save.png" height="18px;"/><span>Sauvegarder</span>
                    </button>
                    <div id="chosen_query_div" style="display: inline;"></div>
                </td>
            </tr>
            <tr>
                <td>
                    <div id="filters" style="display: inline;">
                        <div id="active_filters"></div>
                        <div id="filter_actions"></div>
                    </div>
                </td>
                <td>
                    <div id="group_by" style="display: inline;">
                        <div id="active_groupings"></div>
                        <div id="grouping_actions"></div>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div id="extra_choices" style="display: inline;">
                        <div id="active_extra_choices"></div>
                        <div id="extra_choices_actions"></div>
                    </div>
                </td>
            </tr>
        </table>
    </form>
    <div id="resulting_query"{% if not DEBUG_ACTIF %} style="display: none;"{% endif %}></div>
    <div id="resulting_data" style="width: 100%;"></div>
{% endblock %}
